home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Reverting of big array ?
- Date: 28 Mar 1996 01:15:37 GMT
- Organization: systems hk
- Message-ID: <4jcp7p$91e@nadine.teleport.com>
- References: <31587ACF.59D9@teleport.com> <4jbock$s7j@erinews.ericsson.se>
- NNTP-Posting-Host: ip-pdx13-04.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- etmbgom@ericsson.se (Ben van Gompel) wrote:
- >In article <31587ACF.59D9@teleport.com>, GHouck <hksys@teleport.com> writes:
- ..
- Thomas,
- >> It might not be much faster, but I usually use the following:
- >>
- >> for( i=0; i<numChars/2; i++ )
- >> strChars[i] = strChars[numChars-i-1];
- >
- >That won't work.
- >You better use something like:
- >
- ..
- >
- >But still, this won't be fast enough I'd guess.
- >
- >Regards, Ben
- >
-
- Sorry about that,
- Color me crimson! I neglected to include the temporary
- variable. The only advantage I see to this method is
- that there is no need for 2nd string.
-
- char chr;
- ...
- for( i=0; i<numChars/2; i++ ) {
- chr = strChars[i];
- strChars[i] = strChars[numChars-i-1];
- strChars[numChars-i-1] = chr;
- }
- ...
-
- Sorry again,
- Geoff Houck
-
-
-